<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo Yii::$app->name;?> 后台管理</title>
<?php $this->HeaderView();?>

<script>
function view(postid){
    var url = '<?php echo $this->context->getSubmodelActionUrl(['view'])?>?postid='+postid;	
	art.dialog.open(url,{
		id:'view',
		width:480,
		lock:true,
		fixed:true,
		title:'帖子详情'
	});
}

</script>
</head>
<body class="view_index" id="view_index_Article">
<div class="view-index-nav">
        <h3><?php echo $this->context->submodel->models['models']['name'];?></h3>
  <p class="tips">
        <?php echo $this->context->submodel->models['models']['description'];?>
        </p>
</div>


<form class="view-index-form" style="margin:0px 20px" method="POST" action="<?php echo $this->context->getSubmodelActionUrl(['index', 'modelid'=>$this->context->submodel->modelid]);?>" enctype="multipart/form-data">
<table class="view-index-search mb-10" border="0" cellspacing="0" cellpadding="0" width="100%">
<?=$this->csrfToken()?>
        <tr>
        <td class="search">
        <div class="div-search" style="margin:0px 0px">
        <div class="ftr">
        <button class="ui-btn ui-btn-primary mb-10" type="button" onclick="href('<?php echo $this->context->getSubmodelActionUrl(['create', 'modelid'=>$this->context->submodel->modelid]);?>')"><span class="icon-plus">+</span>添加</button>
        
        
        </div>
       <input placeholder="请输入关键字" class="input-keyword" value="<?php echo @$search['keyword'];?>" name="keyword" id="kw" style="width:200px;"/>
       <input id="submit_search" class="button-submit" type="submit" value="搜 索" name="submit_search" />
        <span class="view-index-batch">
        
        </span></div>
         
        </td>
        </tr>
</table>
</form>


<form class="view-index-form" method="post" action="<?php echo $this->context->getSubmodelActionUrl(['batch', 'modelid'=> $this->context->submodel->modelid]);?>" enctype="multipart/form-data">
<input type="hidden" value="<?php echo $this->context->submodel->modelid?>" name="modelid" />
<table class="view-index-list" style="margin-top:0; margin-bottom:0" border="0" cellspacing="0" cellpadding="0" width="100%">
    <thead>
        <tr>
        <th align="left" width="20"><input type="checkbox" value="" name="checked_all"/></th>
                        <?php
						
				        foreach($indexFields as $k=>$val){
						
		                if ($val['field'] == 'listorder'){?>	
                        <th align="left" width="40"><?php echo $val['name']?></th>
                        <?php
						}else if ($val['field'] == 'status'){?>
                        <th align="center" width="50"><?php echo $val['name']?></th>
                        <?php
						}else{
						?>
                        <th align="left" <?php echo $models['models']['setting']['index']['th'][$val['fieldid']]?>><?php echo $val['name']?></th>
                        <?php
						}
						}
						?>
                        
                        
                        
                        <th class="norightborder" width="50">操作</th>
        </tr>
    </thead>
    <tbody id="main">
   <?php
   echo $tr;
	?>
        
        
        
        </tbody>
    
</table>
<table class="view-index-list" style="margin-top:0; border-top:0" border="0" cellspacing="0" cellpadding="0" width="100%">
<tr style="background-color:#eee" class="batch">
<td>
<input type="button" class="button-submit ml-5" value="全选" name="chkall" id="chkall" onclick="checkAll(this, 'checked_id[]');"><input type="button" class="button-submit button-reverse" value="反选" name="chkall" id="chkall" onclick="checkReverse(this, 'checked_id[]');">

<input id="batch_delete" class="button-submit ml-5" type="submit" value="批量删除" name="batch_delete" onclick="return confirm_delete('checked_id[]', this);">

<input id="submit_search" class="button-submit ml-5" type="submit" value="排序" name="batch_listorder">
</td>
</td>
</tr>  
        
        
        </tbody>
    
</table>
<?=$this->csrfToken()?>
</form>

<script>
$(function(){
    $('#main .click_img').toggle(function() { 
	    //展开
		var tr = $(this).parent().parent();
		//tr.clone().
	},function(){
		
	});
});
</script>
<?php $this->FooterView();?>
</body>
</html>